   <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <style>
        div {
            background-color: black;
            border: dashed 15px green;
            padding: 30px;
            color: white;
            font-size: 30px;
            font-weight: bold;
        }


        div.div1 {
            background-clip: border-box;
        }


        div.div2 {
            background-clip: padding-box;
        }

        div.div3 {
            background-clip: content-box;
        }
    </style>

    <div class="div1">示例文字1</div> <br />
    <div class="div2">示例文字2</div> <br />
    <div class="div3">示例文字3</div> <br />
</body>

</html>